{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": false,
    "jupyter": {
     "outputs_hidden": false
    },
    "scrolled": true
   },
   "outputs": [],
   "source": [
    "# 查看当前挂载的数据集目录, 该目录下的变更重启环境后会自动还原\n",
    "# View dataset directory. \n",
    "# This directory will be recovered automatically after resetting environment. \n",
    "!ls /home/aistudio/data"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": false,
    "jupyter": {
     "outputs_hidden": false
    },
    "scrolled": true
   },
   "outputs": [],
   "source": [
    "# 查看工作区文件, 该目录下的变更将会持久保存. 请及时清理不必要的文件, 避免加载过慢.\n",
    "# View personal work directory. \n",
    "# All changes under this directory will be kept even after reset. \n",
    "# Please clean unnecessary files in time to speed up environment loading. \n",
    "!ls /home/aistudio/work"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": false,
    "jupyter": {
     "outputs_hidden": false
    },
    "scrolled": true
   },
   "outputs": [],
   "source": [
    "# 如果需要进行持久化安装, 需要使用持久化路径, 如下方代码示例:\n",
    "# If a persistence installation is required, \n",
    "# you need to use the persistence path as the following: \n",
    "!mkdir /home/aistudio/external-libraries\n",
    "!pip install beautifulsoup4 -t /home/aistudio/external-libraries"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": false,
    "jupyter": {
     "outputs_hidden": false
    },
    "scrolled": true
   },
   "outputs": [],
   "source": [
    "# 同时添加如下代码, 这样每次环境(kernel)启动的时候只要运行下方代码即可: \n",
    "# Also add the following code, \n",
    "# so that every time the environment (kernel) starts, \n",
    "# just run the following code: \n",
    "import sys \n",
    "sys.path.append('/home/aistudio/external-libraries')"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "请点击[此处](https://ai.baidu.com/docs#/AIStudio_Project_Notebook/a38e5576)查看本环境基本用法.  <br>\n",
    "Please click [here ](https://ai.baidu.com/docs#/AIStudio_Project_Notebook/a38e5576) for more detailed instructions. "
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "计算一个2 by 2（即2行2列）的行列式是一个基础且直接的数学过程。行列式是方阵的一个重要属性，对于2 by 2的矩阵，其行列式的计算公式尤为简单。\n",
    "\n",
    "假设我们有一个2 by 2的矩阵 $A$，其形式如下：\n",
    "\n",
    "$$ A = \\begin{pmatrix} a & b \\\\ c & d \\end{pmatrix} $$\n",
    "\n",
    "其中，$a, b, c, d$ 是矩阵的元素。\n",
    "\n",
    "该矩阵的行列式 $|A|$（也称为“det(A)”或“det A”）可以通过以下公式计算：\n",
    "\n",
    "$$ |A| = ad - bc $$\n",
    "\n",
    "这里是一个具体的计算范例：\n",
    "\n",
    "假设矩阵 $A$ 为：\n",
    "\n",
    "$$ A = \\begin{pmatrix} 2 & 3 \\\\ 4 & 5 \\end{pmatrix} $$\n",
    "\n",
    "按照行列式的计算公式，我们有：\n",
    "\n",
    "$$ |A| = 2 \\times 5 - 3 \\times 4 $$\n",
    "$$ |A| = 10 - 12 $$\n",
    "$$ |A| = -2 $$\n",
    "\n",
    "因此，矩阵 $A = \\begin{pmatrix} 2 & 3 \\\\ 4 & 5 \\end{pmatrix}$ 的行列式值为 $-2$。"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "对于一个2 by 2的行列式，其一般形式为：\n",
    "\n",
    "$$\n",
    "\\begin{vmatrix}\n",
    "a & b \\\\\n",
    "c & d\n",
    "\\end{vmatrix}\n",
    "$$\n",
    "\n",
    "其中，$a, b, c, d$ 是行列式中的元素。\n",
    "\n",
    "计算这个行列式的值，我们使用以下公式：\n",
    "\n",
    "$$\n",
    "\\text{行列式的值} = ad - bc\n",
    "$$\n",
    "\n",
    "### 范例\n",
    "\n",
    "假设我们有一个2 by 2的行列式如下：\n",
    "\n",
    "$$\n",
    "\\begin{vmatrix}\n",
    "2 & 3 \\\\\n",
    "4 & 5\n",
    "\\end{vmatrix}\n",
    "$$\n",
    "\n",
    "按照上述公式，我们可以计算其值为：\n",
    "\n",
    "$$\n",
    "(2 \\times 5) - (3 \\times 4) = 10 - 12 = -2\n",
    "$$\n",
    "\n",
    "因此，该行列式的值为 $-2$。"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "py35-paddle1.2.0"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.10.10"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 4
}
